package cn.amoqi.springboot.rabbit.rabbit.hello;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 一个发送者，多个接收者
 */
@Component
public class Hello2Receiver {
    @RabbitHandler
    @RabbitListener(id = "Hello2Receiver1", queues = "hello2")
    public void receiver(String str) {
        System.out.println("Receive1:" + str);
    }

    @RabbitHandler
    @RabbitListener(id = "Hello2Receiver2", queues = "hello2")
    public void receiver2(String str) {
        System.out.println("Receive2:" + str);
    }
}
